USE [Detail]
GO

/****** Object:  Table [dbo].[Disputes]    Script Date: 03/18/2015 00:08:56 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Disputes](
	[disputeId] [int] NOT NULL,
	[merchantId] [int] NOT NULL,
	[disputeDesc] [varchar](50) NULL,
	[disputeAmt] [decimal](10, 2) NULL,
	[prodCode] [int] NOT NULL,
	[status] [char](1) NULL,
	[cardHolderNumber] [varchar](20) NULL,
	[cardType] [varchar](10) NULL,
	[jurisdiction] [varchar](20) NULL,
	[transactionId] [varchar](30) NULL,
	[tranDate] [datetime] NULL,
	[tranAmount] [decimal](10, 2) NULL,
	[reasonCode] [varchar](50) NULL,
	[dueDate] [datetime] NULL,
	[ccn] [varchar](30) NULL,
PRIMARY KEY CLUSTERED 
(
	[disputeId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[Disputes]  WITH CHECK ADD FOREIGN KEY([merchantId])
REFERENCES [dbo].[Merchants] ([merchantId])
GO

ALTER TABLE [dbo].[Disputes]  WITH CHECK ADD CHECK  (([status]='C' OR [status]='W' OR [status]='O'))
GO


